package com.example.zhengwei.base.touch;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;

import com.example.zhengwei.base.R;

/**
 * Created by zhengwei on 2015/10/22.
 */
public class TouchActivity extends Activity{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.touch_activity);
        Log.d("TouchActivity", "onCreate");
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.d("TouchActivity", "dispatchTouchEvent-->" + TouchEventUtil.getTouchAction(ev.getAction()));
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean ret = super.onTouchEvent(event);
        Log.d("TouchActivity", "onTouchEvent-->" + TouchEventUtil.getTouchAction(event.getAction()) + " result-->" + ret);
        return ret;
    }
}
